# this is a prelimary makefile for diff_2d

# program name
PROG = diff_2d

SRCS =	class_2d_matx.f90 class_dat.f90 class_input.f90 class_output.f90 \
	    class_solver.f90 diff_2d.f90 matx_const.f90

OBJSS =	class_2d_matx.o class_dat.o class_input.o class_output.o \
     	class_solver.o diff_2d.o matx_const.o


# fortran compiler
#FC              = mpif90

PETSC_DIR = /home/robertsj/opt/petsc/petsc-3.1-p6/

include ${PETSC_DIR}/conf/variables
include ${PETSC_DIR}/conf/rules

CFLAGS	        = 
FFLAGS	        = -I${PETSC_DIR}/include/finclude -ffree-form -I/home/robertsj/opt/silo/silo-4.7.2/include
CPPFLAGS        =
FPPFLAGS        =
LIBRARY         = -L/home/robertsj/opt/silo/silo-4.7.2/lib/ -lsilo -lm

# Suffix-rules:  Begin by throwing away all old suffix-
# rules, and then create new ones for compiling 
# *.f90-files.
.SUFFIXES:
.SUFFIXES: .f90 .o .F

# general rule for object creation
#.F.o:
#	$(FC) $(FFLAGS) -c $<
	
# include the dependency-list created by makedepf90 below
include .depend

# all is generic target to be used in place of program (for eclipse)
all: $(PROG) 

# build program
$(PROG): $(OBJSS)
	$(FLINKER) -v -o $@ $(OBJSS) ${PETSC_SYS_LIB} ${LIBRARY}
	
# target 'clean' for deleting o's and mod's
clean::
	rm -f *.o *.mod 
	
# Create a dependency list using makedepf90.  All files 
# that needs to be compiled to build the program, 
# i.e all source files except include files, should 
# be given on the command line to makedepf90.  
depend .depend:
	makedepf90 *.f90 *.F > .depend

